//#define __DEBUG__
// by Xeno
#define THIS_FILE "fn_posbehind.sqf"
#include "x_setup.sqf"

private ["_p1", "_p2", "_mdist", "_hdist", "_dist", "_dir", "_dirn", "_x1", "_y1"];
PARAMS_2(_p1,_p2);
_mdist = _p1 distance _p2;
_hdist = _mdist * 1.7;
_dist = _mdist + ((_hdist - _mdist) min 900);//900
_dir = [_p1, _p2] call FUNC(DirTo);
_dirn = _dir + 180;
_x1 = (_p1 select 0) - (_dist * sin _dirn);
_y1 = (_p1 select 1) - (_dist * cos _dirn);
//[QUOTE(blablablaxx),[_x1,_y1],"ICON","ColorBlue",[1,1],"",0,"mil_dot"] call FUNC(CreateMarkerLocal);
[[_x1,_y1,0], _dirn];